package com.ticket.sass.admin.dto.input.commodity;

import com.ticket.sass.admin.validator.InEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @author ywb
 * @date 2023-04-04 10:26
 */
@Data
@ApiModel(value = "卖品修改输入DTO", description = "按照要求填写")
public class CommodityUpdInput {
    @ApiModelProperty(value = "ID", required = true)
    @NotNull(message = "ID不能为空")
    private Long id;
    
    @ApiModelProperty(value = "卖品名称", required = true)
    @NotBlank(message = "卖品名称不能为空")
    private String name;
    
    @ApiModelProperty(value = "卖品描述", required = true)
    private String desc;
    
    @Valid
    @NotNull(message = "封面图不能为空")
    @Size(min = 1, message = "封面图不能为空")
    @ApiModelProperty(value = "封面图", required = true)
    private List<@NotBlank(message = "封面图不能为空") String> cover;
    
    @NotNull(message = "发布状态不能为空")
    @InEnum(intValues = {0, 1})
    @ApiModelProperty(value = "发布状态：0 未发布，1已发布")
    private Short publishStatus;
    
    @ApiModelProperty(value = "分类ID")
    private Integer categoryId = 0;
    
    @ApiModelProperty(value = "配送方式 1 平台核销")
    private Short dispatchGuide;
    
    @ApiModelProperty(value = "核销方式 1 平台核销")
    private Short useMethod;
    
    @ApiModelProperty(value = "是否支持退款")
    private Short refund;
    
    @Valid
    @NotNull(message = "请至少写一种规格")
    @Size(min = 1, message = "请至少写一种规格")
    @ApiModelProperty(value = "卖品规格", required = true)
    private List<CommoditySkuInput> commoditySkus;
}
